1. /* sdmcnvsl.cpp by K.Tsuru */
  2. // function ID = 305 DRADIX, BRADIX
  3. #ifndef SN_H
  4. #include "sn.h"
  5. #endif
  6. /**************************************************************
  7. SDouble and SDecimal classes
  8. It makes a SLong value result=(figure[top],...,figure[last]).
  9. It is used in DDMult().
  10. ***************************************************************/
  11. void SDouble::ConvertToSLong(uint top, uint last, SLong& result) const{
  12. uint fs = max(top, First()), ls = min(last, Last());
  13. if( (top >= figure.size()) || (fs > ls) || (top > last) || (First() > last) ){
  14. //All the elements are zero
  15. if(result.RawSign()) result.SetZero();
  16. return;
  17. }
  18. register uint j;
  19. result.valloc(last - fs + 1u, 0);
  20. const fType* srv = this->ReadFigures();
  21. fType* rv = result.figure.Elements();
  22. #ifndef NDEBUG
  23. result.figure[last-fs] = figure(fs);
  24. result.figure(last-ls);
  25. result.figure[last-ls] = figure(ls);
  26. #endif
  27. for(j = fs; j <= ls; j++) rv[last-j] = srv[j];
  28. result.SetSign(1);
  29. result.CheckArray(305); //It gets the figure position.
  30. }

sdmcnvsl.cpp : last modifiled at 2017/03/13 14:31:57(1,052 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).